package com.deepocean.service.impl;

import com.deepocean.dao.DenseMediumCycloneDao;
import com.deepocean.entity.DenseMediumCycloneCondition;
import com.deepocean.entity.DenseMediumCycloneEntity;
import com.deepocean.entity.DenseMediumCycloneInAndOut1Hour;
import com.deepocean.service.IDenseMediumCycloneService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.UUID;

@Service
public class DenseMediumCycloneServiceImpl implements IDenseMediumCycloneService {
    @Autowired
    DenseMediumCycloneDao denseMediumCycloneDao;
    @Override
    public boolean add(DenseMediumCycloneEntity denseMediumCycloneEntity) {
        String id = UUID.randomUUID().toString().replaceAll("-", "");
        denseMediumCycloneEntity.setId(id);
        return denseMediumCycloneDao.add(denseMediumCycloneEntity);
    }

    @Override
    public DenseMediumCycloneInAndOut1Hour getInAndOutInHour(String deviceId) {
        return denseMediumCycloneDao.getInAndOutInHour(deviceId);
    }

    @Override
    public List<DenseMediumCycloneEntity> getDenseMediumCycloneByCondition(DenseMediumCycloneCondition denseMediumCycloneCondition) {
        return denseMediumCycloneDao.getDenseMediumCycloneByCondition(denseMediumCycloneCondition);
    }
}
